<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p>点击抽奖---<span></span></p>
    <button id="start">开始</button>
    <button id="pause">暂停</button>
    <script>
        var arr = ['唱','跳','rap','篮球']
        var start = document.getElementById('start')
        var pause = document.getElementById('pause')
        var control
        start.onclick = function(){
            control = setInterval(
                    function(){
                        var i = Math.floor(Math.random()*arr.length)
                        document.querySelector('span').innerHTML = arr[i]
                    },100
                )
            }
            
        pause.onclick = function(){
            clearInterval(control);
        }    
    </script>
</body>
</html>